// pages/active/active.js
var app = getApp()
var utils = require('../../utils/util.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {

    },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    var sucFunc = function (that, res) {
      that.setData({
        active:res.data,
        imgPath: app.d.imgPath
      })
      wx.hideLoading();
    }
    var data = { openid: app.d.openid }
    utils.wxRequest(that, app.d.path, "My/activity", data, sucFunc);
  },
  dateil: function (e) {
    var that = this;
    var id = e.currentTarget.id;
    wx.navigateTo({
      url: "/pages/activeDetail/activeDetail?id=" + id
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },

  cutover: function (e) {
    var that = this;
    var url = e.currentTarget.id;
    wx.navigateTo({
      url: url
    })
  },
  cutovers: function (e) {
    var that = this;
    var url = e.currentTarget.id;
    wx.navigateTo({
      url: url
    })
  },
})